<?php
/**
 * 退出
 * Created by PhpStorm.
 * User: zhang-hong
 * Date: 2017/3/6
 * Time: 17:46
 */
class LogoutController extends Yaf_Controller_Abstract
{
    function IndexAction()
    {
        //初始化
        //G('begin');
        $request = $this->getRequest();
        $session_id = $request->getPost("session_id","");
        if($session_id == "")
        {
            Utility::apiJsonError(20030, 'session ID不能为空!');

        }else{
            DB::delete("yiyuan_sess")
                ->where("sesskey","=",$session_id)
                ->execute();
            $data["msg"] = "";
            $data["error"] = 200;
            Utility::apiJsonResultExtends($data);
        }
//        $yiyuan_id = $request->getPost("yiyuan_id",0);
//        $session_id = $_REQUEST["session_id"];

        //结束
        //$this->apiLog(0);

    }
}